import java.util.Arrays;

public class Solution2022 {
    public int[][] construct2DArray(int[] original, int m, int n) {
        int l=original.length;
        if (l!=m*n){
            return new int[0][];
        }
        int[][] ans=new int[m][n];
        for (int i=0;i<l;i++){
            ans[i/n][i%n]=original[i];
        }
        return ans;
    }

    public static void main(String[] args) {
        int[][] m=new Solution2022().construct2DArray(new int[]{1,2,3,4},2,2);
        for (int[] ints : m) {
            System.out.println(Arrays.toString(ints));
        }
    }
}
